﻿using ModuleViewE.ViewModels;
using ModuleViewE.Views;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;

namespace ModuleViewE
{
    public class ModuleViewEModule : IModule
    {
        public void OnInitialized(IContainerProvider containerProvider)
        {
            //注册ViewD到主程序的ContentRegion区域中
            var regionManager = containerProvider.Resolve<IRegionManager>();
            //regionManager.RegisterViewWithRegion("ContentRegion", typeof(ViewE));

            regionManager.Regions["ContentRegion"].RequestNavigate("ViewE");
        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            //将视图类型 ViewE 和视图模型类型 ViewEViewModel 关联起来
            containerRegistry.RegisterForNavigation<ViewE, ViewEViewModel>();
        }
    }
}